﻿using System;
using System.Collections.Generic;
using System.Linq;
using CardGamesLibrary.Cards;
using CardGamesLibrary.Games;
using CardGamesLibrary.Tables;

namespace CardGamesLibrary.Turns
{
    public class GameTurn : Turn
    {
        private readonly IEnumerable<TableSeat> _seats;

        public GameTurn(IEnumerable<TableSeat> seats)
        {
            _seats = seats;
        }

      
        public virtual TableSeat GetWinner()
        {
            
            var tableSeat = _seats.FirstOrDefault(a => a.Player != null);
            return tableSeat;
        }
       

        public override void Play()
        {
            new TableTurn(_seats).Play();
            Finished = true;
        }
    }
}
